<html>
<head><meta charset="utf-8"><title>exclude/skip some test · t-cargo · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/index.html">t-cargo</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/exclude.2Fskip.20some.20test.html">exclude/skip some test</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="230119757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/exclude/skip%20some%20test/near/230119757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Leo Le Bouter <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/exclude.2Fskip.20some.20test.html#230119757">(Mar 13 2021 at 00:20)</a>:</h4>
<p>Hello!</p>
<p>I see it is possible to execute some tests by their name, but is it possible to exclude some tests while running all other known ones?</p>
<p>Thank you</p>



<a name="230120026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/exclude/skip%20some%20test/near/230120026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/exclude.2Fskip.20some.20test.html#230120026">(Mar 13 2021 at 00:24)</a>:</h4>
<p>If you're referring to Cargo integration tests, there isn't any option to exclude. If possible, you can use glob patterns.</p>
<p>If you're referring to test function names, the test runner supports the <code>--skip</code> option (see <a href="https://doc.rust-lang.org/nightly/rustc/tests/index.html#selection-options">docs</a>)</p>



<a name="230120223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/exclude/skip%20some%20test/near/230120223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Leo Le Bouter <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/exclude.2Fskip.20some.20test.html#230120223">(Mar 13 2021 at 00:27)</a>:</h4>
<p><span class="user-mention" data-user-id="120518">@Eric Huss</span> thanks for answering, I mean when using cargo on some project: <code>cargo test</code>, how to exclude some tests. So I use RUSTFLAGS to set the <code>--skip</code> option?</p>



<a name="230120236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/exclude/skip%20some%20test/near/230120236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/exclude.2Fskip.20some.20test.html#230120236">(Mar 13 2021 at 00:27)</a>:</h4>
<p>The arguments go after the <code>--</code>.  For example, <code>cargo test -- --skip=testname</code></p>



<a name="230120256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/exclude/skip%20some%20test/near/230120256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Leo Le Bouter <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/exclude.2Fskip.20some.20test.html#230120256">(Mar 13 2021 at 00:28)</a>:</h4>
<p><span class="user-mention" data-user-id="120518">@Eric Huss</span> actually just saw that a bit above in the docs, thanks a lot!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>